home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
qbnws204.zip
/
WINDOWS.ZIP
/
WINDOWS.REF
< prev
Wrap
Text File
|
1991-10-16
|
5KB
|
140 lines
=======================================================================
Routine Reference Section
=======================================================================
Popup Window manager for QuickBASIC V4.x, Microsoft BASIC 6.x, and
the Microsoft BASIC Professional Development System 7.x.
Written by Christy Gemmell
Singular Software
22 Peake Road, Northfields
Leicester LE4 7DN, England
For QBNews and released into the Public Domain.
=======================================================================
EXPLODE
Clear a screen rectangle explosively.
DECLARE SUB Explode (BYVAL Y1%, BYVAL X1%, BYVAL Y2%, BYVAL X2%,_
BYVAL Attr%, BYVAL Speed%)
Arguments: Y1% = Upper-left row of rectangle to be cleared
X1% = Upper-left column of rectangle
Y2% = Lower-right row of rectangle
X2% = Lower-right column of rectangle
Attr% = Display attribute or colour that rectangle
should be cleared to
Speed% = Speed (in milliseconds) of explosion.
The panel is cleared, starting at the centre point, and progressively
moving outwards until the defined borders are reached. This gives the
impression of the clear area exploding onto the screen.
This routine is called, internally, by the POPUP window function (see
below) whenever Zoom is specified.
POPUP
This is the Toolbox popup window generator.
DECLARE SUB PopUp (BYVAL Row%, BYVAL Col%, BYVAL Hght%, BYVAL Wdth%,_
BYVAL Attr%, BYVAL Brdr%, BYVAL Shdw%, BYVAL Zoom%)
Opens a popup window at the screen location specified.
Where: Row% is the top-left row co-ordinate
Col% is the top-left column co-ordinate
Hght% is the height (in rows) of the window
Wdth% is the width (in columns) of the window
Attr% is the display attribute or colour
Brdr% is the border style (0 = no border)
Shdw% is the shadow switch (0 = no shadow)
Zoom% is the zoom switch (0 = no zoom)
The first four parameters specify the size of the window and the location
on the screen at which it will appear. Border styles are as follows:
┌────┐
│ 1. │ Single-lined box all round the window
└────┘
╔════╗
║ 2. ║ Double-lined box all round the window
╚════╝
╒════╕
│ 3. │ Single vertical, double horizontal
╘════╛
╓────╖
║ 4. ║ Single horizontal, double vertical
╙────╜
╤════╤
│ 5. │ Single-lined box all round the window
╘════╛
╦════╦
║ 6. ║ Double-lined box all round the window
╚════╝
┬────┬
│ 7. │ Single vertical, double horizontal
╘════╛
╥────╥
║ 8. ║ Single horizontal, double vertical
╙────╜
Border styles 5 through 8 are particularly suitable for use with pull-
down menus, descending from a horizontal bar.
The SHADOW switch (Parameter 7), can be used to add a black shadow beneath
your window, giving it a three dimensional effect. Setting Shdw% to 1 puts
solid shadow on the left-hand side. Setting Shdw% to 2 puts it on the right.
values of 3 and 4 in Shdw% will display transparant shadow to the left or
right, respectively, any other value prevents shadow.
Setting Parameter 8 to a non-zero value will cause the window to ZOOM onto
the screen. What this means is that, starting at a point source,
successively larger versions of the window will be drawn until it is the
size required. The value you supply sets the interval, in milliseconds,
between iterations and is used to control the speed at which the window
explodes onto the screen.
To preserve compatibility with programs written for use with previous
versions of the Toolbox, a value of -1 in parameter 8 sets the default
delay of 20 milliseconds per iteration. At this speed, which is constant
on PCs with all types of microprocessor, the process is extremely fast
and impressive, and adds a very professional touch to your programs.
Before a window is opened, the display area below it is copied to an
internal buffer, from where it will be eventually restored when the window
is closed. This buffer has a capacity of 8 KiloBytes, the equivalent of
two full screens. To calculate the storage required for a particular
window, use the formula:
Bytes = ((Height in rows * Width in columns) * 2) + 6
(add one row to the height and one column to the width if you specify
shadow)
The window area needs to be multiplied by 2 since each screen character
takes two bytes of memory, for itself and its attribute code. The odd six
bytes are required for the storage of buffer pointers. The window buffer
works as a LIFO (Last In First Out) stack, so that the last window opened
is the first one to be removed.
SHUTUP
Closes the last window opened by the POPUP window procedure (see above)
and restores the contents of the screen below it.
DECLARE SUB ShutUp (BYVAL Speed%)
The Speed% parameter is a delay in milliseconds. If greater than zero
it produces the effect of imploding the storage buffer contents onto the
screen, making the window appear to vanish into a point source.
Note: setting Speed% to -1 produces a default delay of 20 milliseconds
per iteration.